import { defineComponent as h, reactive as m, watch as g, toRefs as I } from "vue-demi";
import { openBlock as u, createElementBlock as r, createElementVNode as s, toDisplayString as a, createTextVNode as l, createCommentVNode as f, pushScopeId as v, popScopeId as y } from "vue";
const E = /-(\w)/g;
function p(e) {
  return e.replace(E, (o, t) => t.toUpperCase());
}
const D = "frog";
function S(e) {
  return e = `${D}-${e}`, [e, p(`-${e}`)];
}
function $(e) {
  return e.install = (o) => {
    const t = e.name, [n, i] = S(t);
    o.component(n, e), o.component(i, e), o.component(t, e), o.component(p(`-${t}`), e);
  }, e;
}
const C = (e) => e != null && e.startsWith("http") || e != null && e.startsWith("data:image") ? e : e ? `data:image/png;base64,${e}` : "", N = (e) => {
  if (e) {
    const o = e == null ? void 0 : e.split(" ")[0];
    let t = ["\u3007", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u4E03", "\u516B", "\u4E5D", "\u5341"], n = o.replace(/[^0-9]+/g, ""), i = t[n[0]] + t[n[1]] + t[n[2]] + t[n[3]], d = n[4] === "0" ? t[n[5]] : t[10] + (n[5] > 0 ? t[n[5]] : ""), c = "";
    return n[6] === "0" ? c = t[n[7]] : n[6] === "1" ? n[7] === "0" ? c = t[10] : c = t[10] + t[n[7]] : (n[6] === "2" || n[6] === "3") && (n[7] === "0" ? c = t[n[6]] + t[10] : c = t[n[6]] + t[10] + t[n[7]]), i + " \u5E74 " + d + " \u6708 " + c + " \u65E5 ";
  }
};
const k = (e, o) => {
  const t = e.__vccOpts || e;
  for (const [n, i] of o)
    t[n] = i;
  return t;
}, B = h({
  name: "certificated",
  props: {
    childData: {
      type: Object,
      default: () => {
      }
    }
  },
  setup(e, { root: o }) {
    const t = m({
      studentInfo: {}
    });
    return g(() => e.childData, (n) => {
      t.studentInfo = { ...n };
      const { oneApplyTime: i, graduationDatetime: d } = t.studentInfo;
      t.studentInfo.startTime = i == null ? void 0 : i.split(" ")[0], t.studentInfo.endTime = d == null ? void 0 : d.split(" ")[0];
    }, {
      deep: !0,
      immediate: !0
    }), {
      ...I(t),
      getImage: C,
      dateToChinese: N
    };
  }
}), _ = (e) => (v("data-v-7523f607"), e = e(), y(), e), T = { id: "certificate-container" }, w = /* @__PURE__ */ _(() => /* @__PURE__ */ s("h2", { class: "title" }, "\u9053\u8DEF\u8FD0\u8F93\u4ECE\u4E1A\u8D44\u683C\u57F9\u8BAD\u7ED3\u4E1A\u8BC1\u4E66", -1)), z = { class: "text-right" }, P = { class: "container" }, V = { class: "desc" }, b = { class: "line" }, O = { class: "line" }, R = { class: "picture" }, W = ["src"], j = { class: "signature" }, U = { class: "signature_inner" }, q = /* @__PURE__ */ _(() => /* @__PURE__ */ s("div", null, "\u57F9\u8BAD\u5355\u4F4D(\u76D6\u7AE0)\uFF1A", -1)), A = { class: "sign" }, F = { class: "sign_pic" }, G = ["src"], H = { class: "signtime" };
function J(e, o, t, n, i, d) {
  return u(), r("div", T, [
    w,
    s("p", z, "[\xA0\u7ED3\u4E1A\u8BC1\u4E66\u7F16\u53F7: " + a(e.studentInfo.finishStudyCode) + "\xA0]", 1),
    s("div", P, [
      s("p", V, [
        l(" \u5B66\u5458 "),
        s("span", b, a(e.studentInfo.name), 1),
        l(" \uFF08\u8EAB\u4EFD\u8BC1\u53F7\uFF1A" + a(e.studentInfo.cardNo) + "\uFF09\u4E8E " + a(e.studentInfo.startStudyDate) + " \u81F3 " + a(e.studentInfo.endStudyDate) + " \u671F\u95F4\u53C2\u52A0\u6211\u6821", 1),
        s("span", O, a(e.studentInfo.applyTypeAlias), 1),
        l(" \u4ECE\u4E1A\u8D44\u683C\u57F9\u8BAD\uFF0C\u5E76\u6309\u8981\u6C42\u5B8C\u6210\u4E86\u6559\u5B66\u5927\u7EB2\u89C4\u5B9A\u5B66\u65F6\u7684\u57F9\u8BAD\uFF0C\u51C6\u4E88\u7ED3\u4E1A\uFF01 ")
      ]),
      s("div", R, [
        e.studentInfo.headImg ? (u(), r("img", {
          key: 0,
          src: e.getImage(e.studentInfo.headImg),
          fit: "['fill']"
        }, null, 8, W)) : f("v-if", !0)
      ])
    ]),
    s("div", null, "(\u62A5\u540D\u7F16\u53F7\uFF1A" + a(e.studentInfo.enrollBatch) + ")", 1),
    s("div", j, [
      s("div", U, [
        q,
        s("div", A, [
          s("span", null, a(e.studentInfo.graduationDatetime), 1),
          s("div", F, [
            e.studentInfo.signaturePhoto ? (u(), r("img", {
              key: 0,
              src: e.getImage(e.studentInfo.signaturePhoto),
              fit: "['fill']"
            }, null, 8, G)) : f("v-if", !0)
          ])
        ])
      ]),
      s("div", H, a(e.dateToChinese(e.studentInfo.graduationDatetime)), 1)
    ])
  ]);
}
const K = /* @__PURE__ */ k(B, [["render", J], ["__scopeId", "data-v-7523f607"]]), Q = $(K);
export {
  Q as default
};
